home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
PROGBLER
/
WHIZZARD.LZH
/
CLREOL.ASM
< prev
next >
Wrap
Assembly Source File
|
1983-06-27
|
3KB
|
107 lines
COMMENT *
CLUBware (tm)
CLREOL clears the screen from the current position to the end
of the current line. Cursor is left at starting
position.
Copyright 1984 Rayhawk Automation N.W. Inc
P.O. Box 1427
Beaverton, Oregon 97075
Algorithm:
1) determine current position
2) determine number of blanks required
3) write that many blanks using INT 10, AH=9
CALL CLREOL ( FLAG% )
FLAG% environment flag
= 0 means under basic interpreter
= 1 means under compiled basic
= 2 means under compiled business basic
*
;______________________________________________________________________________
; Normal assembly directives
CODE SEGMENT PARA PUBLIC 'CODE'
ASSUME CS:CODE
PUBLIC CLREOL
ENV_FLAG EQU WORD PTR [BP+6] ; address of environment flag on stack
;______________________________________________________________________________
CLREOL PROC FAR
PUSH AX ; save all registers used,
PUSH BX ; no data segment local to this
PUSH CX ; routine so segment registers
PUSH DX ; are untouched.
PUSH ES
; ... 0) load environment flag showing compiled or interpreted
MOV BX,ENV_FLAG ; load address of environment flag
; ... 1) load current position from 0000:0450 if compiled
; or from DS:[0056h] if interpreted
SUB AX,AX ; address system memory
MOV ES,AX
CMP WORD PTR DS:[BX],0 ; check environment flag
JNE COMPILED
MOV DX,WORD PTR DS:[0056h] ; load from basic space
XCHG DL,DH ; basic has it reversed
DEC DL ; basic starts count from 1
DEC DH ; instead of zero
JMP SHORT HAVE_POSITION
COMPILED:
MOV DX,WORD PTR ES:[450h] ; load current position
; from system space
HAVE_POSITION:
; ... 2) determine number of blanks required
MOV CX,80 ; first column on line is 0
SUB CL,DL ; subtract off current column
JZ AT_END_OF_LINE ; if zero, then already at end
; ... 3) write that many blanks using INT 10, AH=9
MOV AX,0A20h ; AH = 10 and AL = blank
MOV BX,0000h ; BH = 0 (assume always on page 0
; use existing attribute
INT 10h ; write that many blanks
AT_END_OF_LINE:
POP ES
POP DX
POP CX
POP BX
POP AX
RET 2
CLREOL ENDP
;______________________________________________________________________________
CODE ENDS
END